package com.village.friend.controller;


import com.village.friend.constant.MsgCodeEnum;
import com.village.friend.dto.request.PolicyListDto;
import com.village.friend.dto.response.BaseResponse;
import com.village.friend.entity.UserPolicy;
import com.village.friend.service.UserPolicyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 会员缴费政策表 前端控制器
 * </p>
 *
 * @author yl
 * @since 2021-08-23
 */
@RestController
@RequestMapping("/appUserPolicy")
@Api(tags = "会员缴费政策管理")
public class UserPolicyController {

    @Autowired
    private UserPolicyService policyService;

    @ApiOperation("策略查询")
    @GetMapping("/list")
    public BaseResponse<List<UserPolicy>> list(PolicyListDto param) {
        List<UserPolicy> policies = policyService.queryParam(param);

        return  new BaseResponse(MsgCodeEnum.SUCCESS, policies) ;

    }



}

